Enhance filtering capabilities#204
Conversation
- Add `tag` parameter to `gridpool_trades()` method for filtering trades by tag - Update `GridpoolTradeFilter` dataclass to include `tag` field - Update equality and hash methods to include tag field - Update `from_pb()` and `to_pb()` methods to handle tag serialization - Bump frequenz-api-electricity-trading dependency to 0.9.0 - Update import path for PaginationParams to v1alpha8 Signed-off-by: Phillip Wenig <phillip.wenig@frequenz.com>
474db3c to
9445508
Compare
florian-wagner-frequenz
left a comment
There was a problem hiding this comment.
LGTM, just some minor nits you might want to consider.
9445508 to
55b5096
Compare
florian-wagner-frequenz
left a comment
There was a problem hiding this comment.
LGTM, seems you missed some spots for the doc-string refinement, but I don't think that's blocking.
| trade_ids: List of trade IDs to filter for. | ||
| market_side: The market side to filter for. | ||
| delivery_period: The delivery period to filter for. | ||
| delivery_time_filter: The delivery time to filter for. |
There was a problem hiding this comment.
Nit: one place you missed
There was a problem hiding this comment.
It seems you missed some more. I prefer the phrasing from line 844, as the time filter is more than just the time(span), but also includes the time granularity.
But it's completely optional.
…iltering This change updates the filtering mechanism for gridpool orders and trades to use a more flexible `DeliveryTimeFilter` instead of the restrictive `DeliveryPeriod`. The new filter supports: - Time interval filtering with optional start/end times - Multiple delivery duration filters - More granular control over time-based queries Key changes: - Added `Interval` and `DeliveryTimeFilter` types to support the new filtering API - Replaced `delivery_period` parameter with `delivery_time_filter` across all client methods - Updated CLI to construct `DeliveryTimeFilter` from delivery_start parameter - Migrated tests to use the new filtering types - Updated API imports from v1 to v1alpha8 for common types - Removed dependency on frequenz.client.common.pagination in favor of direct protobuf usage This change maintains backward compatibility by keeping the `delivery_period` parameter in the `create_gridpool_order` method while adding the new `delivery_time_filter` parameter. Signed-off-by: Phillip Wenig <phillip.wenig@frequenz.com>
Signed-off-by: Phillip Wenig <phillip.wenig@frequenz.com>
55b5096 to
5913665
Compare
|
Updated the missed doc string and bumped the |
|
Thanks @phillip-wenig-frequenz and @florian-wagner-frequenz for taking care! |
Tag filtering for gridpool trades: The
gridpool_trades()method now accepts atagparameter to filter trades by tag. TheGridpoolTradeFilterdataclass has been updated accordingly.Flexible time filtering with
DeliveryTimeFilter: Replaced the restrictivedelivery_periodparameter with a more flexibledelivery_time_filteracross gridpool orders and trades methods. The newDeliveryTimeFiltersupports:New types for time filtering: Added
IntervalandDeliveryTimeFiltertypes to support the enhanced filtering API.